package week4;

public class PairOfDice {
    private final int MAX = 6;// maximum face value
    private int dice01, dice02, sum;//current value showing on the die
    private Die FaceValue1, FaceValue2;
    //------------------------------------------------
    // Constructor: Sets the initial face value.
    //------------------------------------------------
    public PairOfDice() {
        FaceValue1 = new Die();
        FaceValue2 = new Die();
    }

    //------------------------------------------------
    // Roll the die and returns the result.
    //------------------------------------------------
    public int rolling() {
        dice01 = (int)(Math.random() * MAX) + 1;
        dice02 = (int)(Math.random() * MAX) + 1;
        sum = dice01 +dice02;
        return sum;
    }

    public void setDice01(int value1) {
        dice01 = value1;
    }
    public int getDice01() {
        return dice01;
    }

    public void setDice02(int value2) {
        dice02 = value2;
    }
    public int getDice02() {
        return dice02;
    }

    @Override
    public String toString() {
        String total;
        total = Integer.toString(sum);
        return total;
    }
}